package com.pinyougou.sms.service;

import javax.jms.JMSException;
import javax.jms.MapMessage;
import javax.jms.Message;
import javax.jms.MessageListener;

public class SmsMessageListener implements MessageListener {

    @Override
    public void onMessage(Message message) {

        //转换位mapMesessage
        MapMessage mapMessage = (MapMessage) message;

        try {
            String phone = mapMessage.getString("phone");
            String code = mapMessage.getString("code");

            System.out.println("监听到消息："+phone+" ******"+code);
        } catch (JMSException e) {
            e.printStackTrace();
        }

    }
}
